package cn.com.jslh.boarpro.main.model;

import android.content.Context;

import com.blankj.utilcode.util.SPUtils;

import org.json.JSONException;
import org.json.JSONObject;

import cn.com.jslh.boarpro.base.BaseApplication;
import cn.com.jslh.boarpro.main.contract.AddTemplateContract;
import cn.com.jslh.boarpro.util.WebService;

/**
 * Created by Administrator on 2017/11/17.
 */

public class AddTemplateModelImpl implements AddTemplateContract.Model {
    @Override
    public void getDatas(Context context, WebService.NetSuccessListener netSuccessListener) {
        JSONObject dataObject = new JSONObject();
        try {
            dataObject.put("pageid",SPUtils.getInstance().getString(BaseApplication.MODULETYPE));
            dataObject.put("userid",SPUtils.getInstance().getString(BaseApplication.FUSERID));
            dataObject.put("lineid",SPUtils.getInstance().getString(BaseApplication.FLINEID));
        } catch (JSONException e) {
            e.printStackTrace();
        }
        new WebService.Builder(context, "loadAddnewShowModel", "WSAddShowFacade")
                .addProperty("jsonString", dataObject.toString())
                .showDialog(true)
                .success(netSuccessListener)
                .post();
    }
}
